﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

using CE.Global;
using CE.User;
using CE.Database;
using CE.CarInsurance;

public partial class car_insurance_quote_details : MyLanguageBasePage
{
    //string _redirectUrl;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            HtmlLink cssButton = new HtmlLink();
            cssButton.Href = Resources.General.CssButtonUrl;
            cssButton.Attributes["rel"] = "stylesheet";
            cssButton.Attributes["type"] = "text/css";
            cssButton.Attributes["media"] = "all";
            Page.Header.Controls.Add(cssButton);

            string strProviderID = "16"; 

            if (Session[CE.Global.General.ProviderCompanyId] != null)
            {
                strProviderID = Session[CE.Global.General.ProviderCompanyId].ToString();
            }
            else
            {
                Response.Redirect("car-details.aspx");
            }

            SetPolicyDetail();
            SetProviderMoreInfo(strProviderID);
            if (lblPackageName.Text != "GluayGluay.com Special")
            {
                imgProviderLogo.ImageUrl = SetProviderLogoUrl(strProviderID);
            }
            else
            {
                lblPackageName.Text += " (" + Resources.CarInsuranceResultPage.SpecialNCB + ")";
                imgProviderLogo.ImageUrl = "/images/public/gluaygluay_logo.png";
                divProvider.Style.Add("display", "none");
            }
            hplViewGarage.NavigateUrl = SetViewGarageUrl(strProviderID);

            hplCallMeTop.NavigateUrl = "/car-insurance/callme.aspx?pcid=" + strProviderID + "&instype=" + lblInsuranceType.Text + "&carid=" + Session[General.CarId].ToString() + "&uid=" + Session[General.UserId].ToString();
            hplCallMeBottom.NavigateUrl = hplCallMeTop.NavigateUrl;
        }
            
    }

    private void SetPolicyDetail()
    {       
        int _resultId = Convert.ToInt32(Session[CE.Global.General.CarResultId]);
        int _providerId = Convert.ToInt32(Session[CE.Global.General.ProviderCompanyId]);

        DataTable _dtResult = GetResultTable( _resultId,_providerId);
        if (_dtResult.Rows.Count > 0)
        {
            lblPackageName.Text = _dtResult.Rows[0]["PackageName"].ToString();
            lblPremium.Text = Convert.ToSingle(_dtResult.Rows[0]["AnnualPremium"]).ToString("#,000.00");

            int _dec = Convert.ToInt32(_dtResult.Rows[0]["DEC"]);
            if (_dec > 0)
            {
                lblDeductible.Text = Convert.ToInt32(_dtResult.Rows[0]["DEC"]).ToString("#,000");
            }
            else
            {
                lblDeductible.Text = Resources.CarInsuranceResultPage.Waived;
            }

            if (Convert.ToInt32(_dtResult.Rows[0]["SumInsured"]) == 0)
            {
                lblCoverOwnDamage.Text = " - ";
            }
            else
            {
                lblCoverOwnDamage.Text = Convert.ToInt32(_dtResult.Rows[0]["SumInsured"]).ToString("#,000");
            }
            if (Convert.ToInt32(_dtResult.Rows[0]["Fire"]) == 0)
            {
                lblFire.Text = " - ";
            }
            else
            {
                lblFire.Text = Convert.ToInt32(_dtResult.Rows[0]["Fire"]).ToString("#,000");
            }
            if (Convert.ToInt32(_dtResult.Rows[0]["Theft"]) == 0)
            {
                lblTheft.Text = " - " ;
            }
            else
            {
                lblTheft.Text = Convert.ToInt32(_dtResult.Rows[0]["Theft"]).ToString("#,000");
            }
           
            lblTPPD.Text = Convert.ToInt32(_dtResult.Rows[0]["TPPD"]).ToString("#,000");
            lblTPBIA.Text = Convert.ToInt32(_dtResult.Rows[0]["TPBIA"]).ToString("#,000");
            lblTPBIP.Text = Convert.ToInt32(_dtResult.Rows[0]["TPBIP"]).ToString("#,000");

            lblPADriver.Text = Convert.ToInt32(_dtResult.Rows[0]["PADriver"]).ToString("#,000");
            lblMED.Text = Convert.ToInt32(_dtResult.Rows[0]["MedicalExpense"]).ToString("#,000");
            lblBailBond.Text = Convert.ToInt32(_dtResult.Rows[0]["BailBond"]).ToString("#,000");


            if (Convert.ToInt32(_dtResult.Rows[0]["IsFloodCover"]) == 0)
            {
                divFlood.Visible = false;
            }
            lblInsuranceType.Text = _dtResult.Rows[0]["InsuranceType"].ToString();
        }


    }

    private DataTable GetResultTable(int ResultId,int ProviderId)
    {
        MyDatabase _db = new MyDatabase();
        string strSQL = "SELECT * FROM fn_CarInsuranceResultSelectSingleItem('" + ResultId + "','" + ProviderId + "')";

        DataTable _dtCarModel = _db.GetDataTable(strSQL);

        return _dtCarModel;
    }

    private string SetProviderLogoUrl(string providerid)
    {
        string strProviderLogo = string.Empty;
        switch (providerid)
        {
            case "16"://AXA
                strProviderLogo = "/images/public/axa_logo.png";
                break;
            case "11"://AZCP
                strProviderLogo = "/images/public/allianz_logo.png";
                break;
            case "32"://BKI
                strProviderLogo = "/images/public/bk_logo.png";
                break;
            case "31"://Chartis
                strProviderLogo = "/images/public/chartis_logo.png";
                break;
            case "41"://Kurnia (KSK)
                strProviderLogo = "/images/public/ksk_logo.png";
                break;
            case "29"://LMG
                strProviderLogo = "/images/public/lmg_logo.png";
                break;
            case "12"://MSIG
                strProviderLogo = "/images/public/msig_logo.png";
                break;
            case "33"://Muangthai
                strProviderLogo = "/images/public/mti_logo.png";
                break;
            case "46"://Tokio Marine
                strProviderLogo = "/images/public/tm_logo.png";
                break;
            case "35"://KPI
                strProviderLogo = "/images/public/krungthai_logo.png";
                break;
            case "39"://Mittare
                strProviderLogo = "/images/public/mittare_logo.png";
                break;
            case "43"://Synmunkong
                strProviderLogo = "/images/public/synmunkong_logo.png";
                break;
            case "45"://Viriyah
                strProviderLogo = "/images/public/viriyah_logo.png";
                break;
            case "50"://SCSMG
                strProviderLogo = "/images/public/scsmg_logo.png";
                break;
            case "58"://Thaivivat
                strProviderLogo = "/images/public/thaivivat_logo.png";
                break;
            case "65"://Dhipaya
                strProviderLogo = "/images/public/dhipaya_logo.png";
                break;
        }
        return strProviderLogo;
    }

    private void SetProviderMoreInfo(string _companyId)
    {
        string strPromoDes = string.Empty;
        if (_companyId == "11")
        {
            lblPromo.Text = Resources.MoreInfo.AZCP_Title; // "Allianz C.P";
            strPromoDes = Resources.MoreInfo.AZCP_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.AZCP_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.AZCP_Line3;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.AZCP_Line4;
        }
        else if (_companyId == "12")
        {
            //lblPromo.Text = "MSIG";
            lblPromo.Text = Resources.MoreInfo.MSIG_Title;
            strPromoDes = Resources.MoreInfo.MSIG_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.MSIG_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.MSIG_Line3;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.MSIG_Line4;
        }
        else if (_companyId == "16")
        {
            //lblPromo.Text = "AXA";
            lblPromo.Text = Resources.MoreInfo.AXA_Title;
            strPromoDes = Resources.MoreInfo.AXA_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.AXA_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.AXA_Line3;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.AXA_Line4;
        }
        else if (_companyId == "29")
        {
            //lblPromo.Text = "LMG Insurance";
            lblPromo.Text = Resources.MoreInfo.LMG_Title;

            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                strPromoDes = Resources.MoreInfo.LMG_Line1;
            }
            else
            {
                strPromoDes = "LMG Insurance Co. Ltd, previously named Narai International Insurance Co. Ltd, "
                + "was established on 27 November 1975. In 2003 the company merged with Kum Klao Insurance Public Co. Ltd and registered under the new name of LMG Insurance Co. Ltd "
                + "on 6 September 2004.";
            }

            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.LMG_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.LMG_Line3;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.LMG_Line4;
        }
        else if (_companyId == "31")
        {
            //lblPromo.Text = "Chartis";
            lblPromo.Text = Resources.MoreInfo.Chartis_Title;
            strPromoDes = Resources.MoreInfo.Chartis_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Chartis_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Chartis_Line3;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Chartis_Line4;
        }
        else if (_companyId == "32")
        {
            //lblPromo.Text = "Bangkok Insurance";
            lblPromo.Text = Resources.MoreInfo.BKI_Title;
            strPromoDes = Resources.MoreInfo.BKI_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.BKI_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.BKI_Line3;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.BKI_Line4;
        }
        else if (_companyId == "33")
        {
            lblPromo.Text = Resources.MoreInfo.MuangThai_Title;
            strPromoDes = Resources.MoreInfo.MuangThai_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.MuangThai_Line2;

        }
        else if (_companyId == "35")
        {
            lblPromo.Text = Resources.MoreInfo.KPI_Title;
            strPromoDes = Resources.MoreInfo.KPI_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.KPI_Line2;

        }
        else if (_companyId == "39")
        {
            lblPromo.Text = Resources.MoreInfo.Mittare_Title;
            strPromoDes = Resources.MoreInfo.Mittare_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Mittare_Line2;

        }
        else if (_companyId == "41")
        {
            lblPromo.Text = Resources.MoreInfo.KSK_Title;
            strPromoDes = Resources.MoreInfo.KSK_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.KSK_Line2;
        }
        else if (_companyId == "43")
        {
            lblPromo.Text = Resources.MoreInfo.SMK_Title;
            strPromoDes = Resources.MoreInfo.SMK_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.SMK_Line2;

        }
        else if (_companyId == "45")
        {
            lblPromo.Text = Resources.MoreInfo.Viriyah_Title;
            strPromoDes = Resources.MoreInfo.Viriyah_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Viriyah_Line2;

        }
        else if (_companyId == "46")
        {
            lblPromo.Text = Resources.MoreInfo.Tokio_Title;
            strPromoDes = Resources.MoreInfo.Tokio_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Tokio_Line2;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Tokio_Line3;
        }
        else if (_companyId == "50")
        {
            lblPromo.Text = Resources.MoreInfo.SCSMG_Title;
            strPromoDes = Resources.MoreInfo.SCSMG_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.SCSMG_Line2;

        }
        else if (_companyId == "58")
        {
            lblPromo.Text = Resources.MoreInfo.Thaivivat_Title;
            strPromoDes = Resources.MoreInfo.Thaivivat_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Thaivivat_Line2;

        }
        else if (_companyId == "65")
        {
            lblPromo.Text = Resources.MoreInfo.Dhipaya_Title;
            strPromoDes = Resources.MoreInfo.Dhipaya_Line1;
            strPromoDes = strPromoDes + "<br/> <br/>";
            strPromoDes = strPromoDes + Resources.MoreInfo.Dhipaya_Line2;

        }
        lblDescription.Text = strPromoDes;
    }
    private string SetViewGarageUrl(string _companyId)
    {
        string url = string.Empty;
        if (_companyId == "11")
        {
            // "Allianz C.P";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.AllianceWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.AllianceWorkshopEN");
            }

        }
        else if (_companyId == "12")
        {
            //lblPromo.Text = "MSIG";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.MSIGWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.MSIGWorkshopEN");
            }
        }
        else if (_companyId == "16")
        {
            //lblPromo.Text = "AXA";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.AXAWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.AXAWorkshopEN");
            }
        }
        else if (_companyId == "29")
        {
            //lblPromo.Text = "LMG Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.LMGWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.LMGWorkshopEN");
            }
        }
        else if (_companyId == "31")
        {
            //lblPromo.Text = "Chartis";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.ChartisWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.ChartisWorkshopEN");
            }
        }
        else if (_companyId == "32")
        {
            //lblPromo.Text = "Bangkok Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.BKIWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.BKIWorkshopEN");
            }
        }
        else if (_companyId == "33")
        {
            //lblPromo.Text = "MTI Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.MTIWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.MTIWorkshopTH");
            }
        }
        else if (_companyId == "35")
        {

            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.KPIWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.KPIWorkshopTH");
            }
        }
        else if (_companyId == "39")
        {

            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.MittareWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.MittareWorkshopEN");
            }
        }
        else if (_companyId == "41")
        {
            //lblPromo.Text = KSK "Kurnia Insurance";  
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.KSKWorkShopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.KSKWorkShopTH");
            }
        }
        else if (_companyId == "43")
        {
            //lblPromo.Text = "Syn Mun Kong Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.SMKWorkShopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.SMKWorkShopTH");
            }
        }
        else if (_companyId == "45")
        {
            //lblPromo.Text = "Viriyah Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.ViriyahWorkShopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.ViriyahWorkShopTH");
            }
        }
        else if (_companyId == "46")
        {
            //lblPromo.Text = "TMS Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.TokioWorkShopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.TokioWorkShopEH");
            }
        }
        else if (_companyId == "50")
        {
            //lblPromo.Text = "TMS Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.SCSMGWorkshopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.SCSMGWorkshopEN");
            }
        }
        else if (_companyId == "58")
        {
            //lblPromo.Text = "TMS Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.ThaivivatWorkShopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.ThaivivatWorkShopEN");
            }
        }
        else if (_companyId == "65")
        {
            //lblPromo.Text = "Dhipaya Insurance";
            if (HttpContext.Current.Session["Language"].ToString() == "th-TH")
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.DhipayaWorkShopTH");
            }
            else
            {
                url = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.DhipayaWorkShopEN");
            }
        }
        return url;
    }

    private string SetBuyNowUrl(string providerid)
    {
        string _redirectUrl=string.Empty;
        if (providerid == "11")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/azcp_proposal_form.aspx", Page);
        }
        else if (providerid == "12")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/msig_proposal_form.aspx", Page);
        }
        else if (providerid == "16")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/axa_proposal_form.aspx", Page);
        }
        else if (providerid == "29")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/lmg_proposal_form.aspx", Page);
        }
        else if (providerid == "31")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/chartis_proposal_form.aspx", Page);
        }
        else if (providerid == "32")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/bki_proposal_form.aspx", Page);
        }
        else if (providerid == "33")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/mti_proposal_form.aspx", Page);
        }
        else if (providerid == "35")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/krungthai_proposal_form.aspx", Page);
        }
        else if (providerid == "39")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/mittare_proposal_form.aspx", Page);
        }
        else if (providerid == "41")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/ksk_proposal_form.aspx", Page);
        }
        else if (providerid == "43")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/synmunkong_proposal_form.aspx", Page);
        }
        else if (providerid == "45")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/viriyah_proposal_form.aspx", Page);
        }
        else if (providerid == "46")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/tms_proposal_form.aspx", Page);
        }
        else if (providerid == "50")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/scsmg_proposal_form.aspx", Page);
        }
        else if (providerid == "58")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/tvv_proposal_form.aspx", Page);
        }
        else if (providerid == "65")
        {
            _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/proposalforms/dhipaya_proposal_form.aspx", Page);
        }
        return _redirectUrl;
    }

    protected void btnBack_Click(object sender, EventArgs e)
    {
        string _redirectUrl = CE.Global.General.GetUrl("~/car-insurance/quote-results.aspx", Page);
        Response.Redirect(_redirectUrl);
    }

    protected void btnBuyNow_Click(object sender, EventArgs e)
    {
        if (Session[CE.Global.General.ProviderCompanyId] != null)
        {
            string _redirectUrl;
            _redirectUrl = SetBuyNowUrl(Session[CE.Global.General.ProviderCompanyId].ToString());
            Response.Redirect(_redirectUrl);
        }
        else
        {
            Response.Redirect("car-details.aspx");
        }
    }
}

